from PyQt5.QtSvg import QSvgRenderer
from PyQt5.QtGui import QPixmap, QImage

class SvgIconRenderer:
    def __init__(self, svg_path):
        self.renderer = QSvgRenderer(svg_path)

    def render(self, width, height):
        image = QImage(width, height, QImage.Format_ARGB32)
        image.fill(0x00000000)
        painter = QPainter(image)
        self.renderer.render(painter)
        painter.end()
        return QPixmap.fromImage(image)